home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3017 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. Path: newsfeed.internetmci.com!xmission!news
  2. From: tknarr@xmission.com  ( Todd Knarr )
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: [] overload..(newbie in distress)
  5. Date: 21 Jan 1996 17:49:10 GMT
  6. Organization: Chaos Central
  7. Message-ID: <4dtuam$hf4@news.xmission.com>
  8. References: <DLGppJ.31C@undergrad.math.uwaterloo.ca> <Robert.Lendvai-2101960118330001@129.170.80.94>
  9. Reply-To: tknarr@xmission.com ( Todd Knarr )
  10. NNTP-Posting-Host: slc65.xmission.com
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. >In article <DLGppJ.31C@undergrad.math.uwaterloo.ca>,
  14. >tthiraku@landen.math.uwaterloo.ca (Thanou Thirakul) wrote:
  15. >>    A[5] = val;  // store val into the fifth node of a linklist. 
  16. >>    val = A[5] ; // returns the value of the fifth node of a linklist.  
  17.  
  18. It involves the return value of the operator[]() function. If it
  19. returns a reference, you can use it on the left side of the assignment.
  20. If it returns a non-reference, you can't.
  21.  
  22. In <Robert.Lendvai-2101960118330001@129.170.80.94>, Robert.Lendvai@dartmouth.edu (Robert Lendvai) writes:
  23. >The = assignment operator can not be overloaded.
  24.  
  25. It can easily be overloaded, the function is operator=(). It is
  26. not inherited by derived classes, that's all.
  27.  
  28. --
  29. Todd Knarr : tknarr@xmission.com      |  finger for PGP public key
  30.                                       |  Member, USENET Cabal
  31.  
  32. Seriously, I don't want to die just yet.  I don't care how
  33. good-looking they are, I! don't! want! to! die!"
  34.                                         -- Megazone ( UF1 )
  35.  
  36.